/** The Web UI Theme-v1.8.0 */
;layui.define("view", function (e) {
    function t(e) {
        e.attr("lay-id");
        var a = e.attr("lay-attr"), e = e.index();
        A.tabsBodyChange(e, {url: a})
    }

    var a, r = layui.jquery, s = layui.laytpl, i = layui.element, l = layui.table, n = layui.upload, o = layui.setter, u = layui.view, d = layui.device(), c = r(window), y = r("body"), m = r("#" + o.container), f = "layui-show", h = "layui-this", p = "layui-disabled", b = "#LAY_app_body", v = "LAY_app_flexible", g = "layadmin-layout-tabs", x = "layadmin-side-spread-sm", C = "layadmin-tabsbody-item", k = "layui-icon-shrink-right", P = "layui-icon-spread-left", F = "layadmin-side-shrink", A = {
        v: "1.8.0", mode: "iframe", req: u.req, exit: u.exit, escape: function (e) {
            return String(e || "").replace(/&(?!#?[a-zA-Z0-9]+;)/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/'/g, "&#39;").replace(/"/g, "&quot;")
        }, on: function (e, a) {
            return layui.onevent.call(this, o.MOD_NAME, e, a)
        }, sendAuthCode: function (i) {
            function l(e) {
                --n < 0 ? (t.removeClass(p).html("\u83b7\u53d6\u9a8c\u8bc1\u7801"), n = i.seconds, clearInterval(a)) : t.addClass(p).html(n + "\u79d2\u540e\u91cd\u83b7"), e || (a = setInterval(function () {
                    l(!0)
                }, 1e3))
            }

            var a, n = (i = r.extend({seconds: 60, elemPhone: "#LAY_phone", elemVercode: "#LAY_vercode"}, i)).seconds, t = r(i.elem);
            i.elemPhone = r(i.elemPhone), i.elemVercode = r(i.elemVercode), t.on("click", function () {
                var a, e = i.elemPhone, t = e.val();
                if (n === i.seconds && !r(this).hasClass(p)) {
                    if (!/^1\d{10}$/.test(t)) return e.focus(), layer.msg("\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u624b\u673a\u53f7");
                    "object" == typeof i.ajax && (a = i.ajax.success, delete i.ajax.success), A.req(r.extend(!0, {
                        url: "/auth/code", type: "get", data: {phone: t}, success: function (e) {
                            layer.msg("\u9a8c\u8bc1\u7801\u5df2\u53d1\u9001\u81f3\u4f60\u7684\u624b\u673a\uff0c\u8bf7\u6ce8\u610f\u67e5\u6536", {icon: 1, shade: 0}), i.elemVercode.focus(), l(), a && a(e)
                        }
                    }, i.ajax))
                }
            })
        }, screen: function () {
            var e = c.width();
            return 1200 < e ? 3 : 992 < e ? 2 : 768 < e ? 1 : 0
        }, sideFlexible: function (e) {
            var a = m, t = r("#" + v), i = A.screen();
            "spread" === e ? (t.removeClass(P).addClass(k), i < 2 ? a.addClass(x) : a.removeClass(x), a.removeClass(F)) : (t.removeClass(k).addClass(P), i < 2 ? a.removeClass(F) : a.addClass(F), a.removeClass(x)), layui.event.call(this, o.MOD_NAME, "side({*})", {status: e})
        }, popup: u.popup, popupRight: function (e) {
            return A.popup.index = layer.open(r.extend({type: 1, id: "LAY_adminPopupR", anim: -1, title: !1, closeBtn: !1, offset: "r", shade: .1, shadeClose: !0, skin: "layui-anim layui-anim-rl layui-layer-adminRight", area: "300px"}, e))
        }, theme: function (e) {
            o.theme;
            var t = layui.data(o.tableName), a = "LAY_layadmin_theme", i = document.createElement("style"),
                l = s([".layui-side-menu,", ".layui-layer-admin .layui-layer-title,", ".layadmin-side-shrink .layui-side-menu .layui-nav>.layui-nav-item>.layui-nav-child", "{background-color:{{d.color.main}} !important;}", ".layadmin-pagetabs .layui-tab-title li:after,", ".layadmin-pagetabs .layui-tab-title li.layui-this:after,", ".layui-nav-tree .layui-this,", ".layui-nav-tree .layui-this>a,", ".layui-nav-tree .layui-nav-child dd.layui-this,", ".layui-nav-tree .layui-nav-child dd.layui-this a", "{background-color:{{d.color.selected}} !important;}", ".layadmin-pagetabs .layui-tab-title li:hover,", ".layadmin-pagetabs .layui-tab-title li.layui-this", "{color: {{d.color.selected}} !important;}", ".layui-layout-admin .layui-logo{background-color:{{d.color.logo || d.color.main}} !important;}", "{{# if(d.color.header){ }}", ".layui-layout-admin .layui-header{background-color:{{ d.color.header }};}", ".layui-layout-admin .layui-header a,", ".layui-layout-admin .layui-header a cite{color: #f8f8f8;}", ".layui-layout-admin .layui-header a:hover{color: #fff;}", ".layui-layout-admin .layui-header .layui-nav .layui-nav-more{border-top-color: #fbfbfb;}", ".layui-layout-admin .layui-header .layui-nav .layui-nav-mored{border-color: transparent; border-bottom-color: #fbfbfb;}", ".layui-layout-admin .layui-header .layui-nav .layui-this:after, .layui-layout-admin .layui-header .layui-nav-bar{background-color: #fff; background-color: rgba(255,255,255,.5);}", ".layadmin-pagetabs .layui-tab-title li:after{display: none;}", "{{# } }}"].join("")).render(e = r.extend({}, t.theme, e)),
                n = document.getElementById(a);
            "styleSheet" in i ? (i.setAttribute("type", "text/css"), i.styleSheet.cssText = l) : i.innerHTML = l, i.id = a, n && y[0].removeChild(n), y[0].appendChild(i), y.attr("layadmin-themealias", e.color.alias), t.theme = t.theme || {}, layui.each(e, function (e, a) {
                t.theme[e] = a
            }), layui.data(o.tableName, {key: "theme", value: t.theme})
        }, initTheme: function (e) {
            var a = o.theme;
            a.color[e = e || 0] && (a.color[e].index = e, A.theme({color: a.color[e]}))
        }, tabsPage: {}, tabsBody: function (e) {
            return r(b).find("." + C).eq(e || 0)
        }, tabsBodyChange: function (e, a) {
            a = a || {}, A.tabsBody(e).addClass(f).siblings().removeClass(f), z.rollPage("auto", e), layui.event.call(this, o.MOD_NAME, "tabsPage({*})", {url: a.url, text: a.text})
        }, resize: function (e) {
            var a = layui.router().path.join("-");
            A.resizeFn[a] && (c.off("resize", A.resizeFn[a]), delete A.resizeFn[a]), "off" !== e && (e(), A.resizeFn[a] = e, c.on("resize", A.resizeFn[a]))
        }, resizeFn: {}, runResize: function () {
            var e = layui.router().path.join("-");
            A.resizeFn[e] && A.resizeFn[e]()
        }, delResize: function () {
            this.resize("off")
        }, closeThisTabs: function () {
            A.tabsPage.index && r(_).eq(A.tabsPage.index).find(".layui-tab-close").trigger("click")
        }, fullScreen: function () {
            var e = document.documentElement, a = e.requestFullScreen || e.webkitRequestFullScreen || e.mozRequestFullScreen || e.msRequestFullscreen;
            void 0 !== a && a && a.call(e)
        }, exitScreen: function () {
            document.documentElement;
            document.exitFullscreen ? document.exitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitCancelFullScreen ? document.webkitCancelFullScreen() : document.msExitFullscreen && document.msExitFullscreen()
        }
    }, z = A.events = {
        flexible: function (e) {
            e = e.find("#" + v).hasClass(P);
            A.sideFlexible(e ? "spread" : null)
        }, refresh: function () {
            var e = r("." + C).length;
            A.tabsPage.index >= e && (A.tabsPage.index = e - 1), A.tabsBody(A.tabsPage.index).find(".layadmin-iframe")[0].contentWindow.location.reload(!0)
        }, serach: function (t) {
            t.off("keypress").on("keypress", function (e) {
                var a;
                this.value.replace(/\s/g, "") && 13 === e.keyCode && (e = t.attr("lay-action"), a = t.attr("lay-text") || "\u641c\u7d22", e += this.value, a = a + ' <span style="color: #FF5722;">' + A.escape(this.value) + "</span>", layui.index.openTabsPage(e, a), z.serach.keys || (z.serach.keys = {}), z.serach.keys[A.tabsPage.index] = this.value, this.value === z.serach.keys[A.tabsPage.index] && z.refresh(t), this.value = "")
            })
        }, message: function (e) {
            e.find(".layui-badge-dot").remove()
        }, theme: function () {
            A.popupRight({
                id: "LAY_adminPopupTheme", success: function () {
                    u(this.id).render("system/theme")
                }
            })
        }, note: function (e) {
            var a = A.screen() < 2, t = layui.data(o.tableName).note;
            z.note.index = A.popup({
                title: "\u672c\u5730\u4fbf\u7b7e", shade: 0, offset: ["41px", a ? null : e.offset().left - 250 + "px"], anim: -1, id: "LAY_adminNote", skin: "layadmin-note layui-anim layui-anim-upbit", content: '<textarea placeholder="\u5185\u5bb9"></textarea>', resize: !1, success: function (e, a) {
                    e.find("textarea").val(void 0 === t ? "\u4fbf\u7b7e\u4e2d\u7684\u5185\u5bb9\u4f1a\u5b58\u50a8\u5728\u672c\u5730\uff0c\u8fd9\u6837\u5373\u4fbf\u4f60\u5173\u6389\u4e86\u6d4f\u89c8\u5668\uff0c\u5728\u4e0b\u6b21\u6253\u5f00\u65f6\uff0c\u4f9d\u7136\u4f1a\u8bfb\u53d6\u5230\u4e0a\u4e00\u6b21\u7684\u8bb0\u5f55\u3002\u662f\u4e2a\u975e\u5e38\u5c0f\u5de7\u5b9e\u7528\u7684\u672c\u5730\u5907\u5fd8\u5f55" : t).focus().on("keyup", function () {
                        layui.data(o.tableName, {key: "note", value: this.value})
                    })
                }
            })
        }, fullscreen: function (e) {
            var a = "layui-icon-screen-full", t = "layui-icon-screen-restore", e = e.children("i");
            e.hasClass(a) ? (A.fullScreen(), e.addClass(t).removeClass(a)) : (A.exitScreen(), e.addClass(a).removeClass(t))
        }, about: function () {
            A.popupRight({
                id: "LAY_adminPopupAbout", success: function () {
                    u(this.id).render("system/about")
                }
            })
        }, more: function () {
            A.popupRight({
                id: "LAY_adminPopupMore", success: function () {
                    u(this.id).render("system/more")
                }
            })
        }, back: function () {
            history.back()
        }, setTheme: function (e) {
            var a = e.data("index");
            e.siblings(".layui-this").data("index");
            e.hasClass(h) || (e.addClass(h).siblings(".layui-this").removeClass(h), A.initTheme(a))
        }, rollPage: function (e, a) {
            var t, i = r("#LAY_app_tabsheader"), l = i.children("li"), n = (i.prop("scrollWidth"), i.outerWidth()), s = parseFloat(i.css("left"));
            if ("left" === e) !s && s <= 0 || (t = -s - n, l.each(function (e, a) {
                a = r(a).position().left;
                if (t <= a) return i.css("left", -a), !1
            })); else if ("auto" === e) {
                var o, e = l.eq(a);
                if (e[0]) {
                    if ((a = e.position().left) < -s) return void i.css("left", -a);
                    a + e.outerWidth() >= n - s && (o = a + e.outerWidth() - (n - s), l.each(function (e, a) {
                        a = r(a).position().left;
                        if (0 < a + s && o < a - s) return i.css("left", -a), !1
                    }))
                }
            } else l.each(function (e, a) {
                var a = r(a), t = a.position().left;
                if (t + a.outerWidth() >= n - s) return i.css("left", -t), !1
            })
        }, leftPage: function () {
            z.rollPage("left")
        }, rightPage: function () {
            z.rollPage()
        }, closeThisTabs: function () {
            (parent === self ? A : parent.layui.admin).closeThisTabs()
        }, closeOtherTabs: function (e) {
            var t = "LAY-system-pagetabs-remove";
            "all" === e ? (r(_ + ":gt(0)").remove(), r(b).find("." + C + ":gt(0)").remove(), r(_).eq(0).trigger("click")) : (r(_).each(function (e, a) {
                e && e != A.tabsPage.index && (r(a).addClass(t), A.tabsBody(e).addClass(t))
            }), r("." + t).remove())
        }, closeAllTabs: function () {
            z.closeOtherTabs("all")
        }, shade: function () {
            A.sideFlexible()
        }, im: function () {
            A.popup({
                id: "LAY-popup-layim-demo", shade: 0, area: ["800px", "300px"], title: "\u9762\u677f\u5916\u7684\u64cd\u4f5c\u793a\u4f8b", offset: "lb", success: function () {
                    layui.view(this.id).render("layim/demo").then(function () {
                        layui.use("im")
                    })
                }
            })
        }
    }, _ = ((a = layui.data(o.tableName)).theme ? A.theme(a.theme) : o.theme && A.initTheme(o.theme.initColorIndex), "pageTabs" in layui.setter || (layui.setter.pageTabs = !0), o.pageTabs || (r("#LAY_app_tabs").addClass("layui-hide"), m.addClass("layadmin-tabspage-none")), d.ie && d.ie < 10 && u.error("IE" + d.ie + "\u4e0b\u8bbf\u95ee\u53ef\u80fd\u4e0d\u4f73\uff0c\u63a8\u8350\u4f7f\u7528\uff1aChrome / Firefox / Edge \u7b49\u9ad8\u7ea7\u6d4f\u89c8\u5668", {offset: "auto", id: "LAY_errorIE"}), i.on("tab(" + g + ")", function (e) {
        A.tabsPage.index = e.index
    }), A.on("tabsPage(setMenustatus)", function (e) {
        function n(e) {
            return {list: e.children(".layui-nav-child"), a: e.children("*[lay-href]")}
        }

        var s = e.url, e = r("#LAY-system-side-menu"), o = "layui-nav-itemed";
        e.find("." + h).removeClass(h), A.screen() < 2 && A.sideFlexible(), e.children("li").each(function (e, a) {
            var a = r(a), t = n(a), i = t.list.children("dd"), l = s === t.a.attr("lay-href");
            if (i.each(function (e, a) {
                var a = r(a), t = n(a), i = t.list.children("dd"), l = s === t.a.attr("lay-href");
                if (i.each(function (e, a) {
                    var a = r(a), t = n(a);
                    if (s === t.a.attr("lay-href")) return t = t.list[0] ? o : h, a.addClass(t).siblings().removeClass(t), !1
                }), l) return i = t.list[0] ? o : h, a.addClass(i).siblings().removeClass(i), !1
            }), l) return i = t.list[0] ? o : h, a.addClass(i).siblings().removeClass(i), !1
        })
    }), i.on("nav(layadmin-system-side-menu)", function (e) {
        e.siblings(".layui-nav-child")[0] && m.hasClass(F) && (A.sideFlexible("spread"), layer.close(e.data("index"))), A.tabsPage.type = "nav"
    }), i.on("nav(layadmin-pagetabs-nav)", function (e) {
        e = e.parent();
        e.removeClass(h), e.parent().removeClass(f)
    }), "#LAY_app_tabsheader>li"), T = (y.on("click", _, function () {
        var e = r(this), a = e.index();
        A.tabsPage.type = "tab", A.tabsPage.index = a, t(e)
    }), i.on("tabDelete(" + g + ")", function (e) {
        var a = r(_ + ".layui-this");
        e.index && A.tabsBody(e.index).remove(), t(a), A.delResize()
    }), y.on("click", "*[lay-href]", function () {
        var e = r(this), a = e.attr("lay-href"), t = e.attr("lay-text");
        layui.router();
        A.tabsPage.elem = e, (parent === self ? layui : top.layui).index.openTabsPage(a, t || e.text()), a === A.tabsBody(A.tabsPage.index).find("iframe").attr("src") && A.events.refresh()
    }), y.on("click", "*[layadmin-event]", function () {
        var e = r(this), a = e.attr("layadmin-event");
        z[a] && z[a].call(this, e)
    }), y.on("mouseenter", "*[lay-tips]", function () {
        var t, e, a, i = r(this);
        i.parent().hasClass("layui-nav-item") && !m.hasClass(F) || (a = i.attr("lay-tips"), t = i.attr("lay-offset"), e = i.attr("lay-direction"), a = layer.tips(a, this, {
            tips: e || 1, time: -1, success: function (e, a) {
                t && e.css("margin-left", t + "px")
            }
        }), i.data("index", a))
    }).on("mouseleave", "*[lay-tips]", function () {
        layer.close(r(this).data("index"))
    }), layui.data.resizeSystem = function () {
        layer.closeAll("tips"), T.lock || setTimeout(function () {
            A.sideFlexible(A.screen() < 2 ? "" : "spread"), delete T.lock
        }, 100), T.lock = !0
    });
    c.on("resize", layui.data.resizeSystem), (a = o.request).tokenName && ((d = {})[a.tokenName] = layui.data(o.tableName)[a.tokenName] || "", l.set({headers: d, where: d}), n.set({headers: d, data: d})), e("admin", A)
});